// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DriveHeartbeat.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Microsoft.Robotics.Hardware.EV4
{
    using System.Runtime.InteropServices;

    /// <summary>
    /// The Drive heartbeat.
    /// </summary>
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    internal sealed class DriveHeartbeat
    {
        /// <summary>
        /// Time stamp in 10s of milli-seconds
        /// </summary>
        private long timeStamp;

        /// <summary>
        /// Proximity IR sensor 1 reading
        /// </summary>
        private ushort prox1InMm;

        /// <summary>
        /// Proximity IR sensor 2 reading
        /// </summary>
        private ushort prox2InMm;

        /// <summary>
        /// Proximity IR sensor 3 reading
        /// </summary>
        private ushort prox3InMm;

        /// <summary>
        /// Proximity IR sensor 4 reading
        /// </summary>
        private ushort prox4InMm;

        /// <summary>
        /// Proximity IR sensor 5 reading
        /// </summary>
        private ushort prox5InMm;

        /// <summary>
        /// Proximity IR sensor 6 reading
        /// </summary>
        private ushort prox6InMm;

        /// <summary>
        /// Proximity IR sensor 7 reading
        /// </summary>
        private ushort prox7InMm;

        /// <summary>
        /// Proximity IR sensor 8 reading
        /// </summary>
        private ushort prox8InMm;

        /// <summary>
        /// Cliff IR sensor 1 reading
        /// </summary>
        private ushort cliff1InMm;

        /// <summary>
        /// Cliff IR sensor 2 reading
        /// </summary>
        private ushort cliff2InMm;

        /// <summary>
        /// Cliff IR sensor 3 reading
        /// </summary>
        private ushort cliff3InMm;

        /// <summary>
        /// Cliff IR sensor 4 reading
        /// </summary>
        private ushort cliff4InMm;

        /// <summary>
        /// Cliff IR sensor 5 reading
        /// </summary>
        private ushort cliff5InMm;

        /// <summary>
        /// Carry sensor, 1 = carry, 0 = no carry
        /// </summary>
        private byte carryDetected;

        /// <summary>
        /// Internal temperature reading in 10ths of degrees C
        /// </summary>
        private short temperatureInternalIn10thsCelsius;

        /// <summary>
        /// Projector temperature (Red) reading in degrees C
        /// </summary>
        private short temperatureProjectorRedInCelsius;

        /// <summary>
        /// Projector temperature (Green) reading in degrees C
        /// </summary>
        private short temperatureProjectorGreenInCelsius;

        /// <summary>
        /// Projector temperature (Blue) reading in degrees C
        /// </summary>
        private short temperatureProjectorBlueInCelsius;

        /// <summary>
        /// Projector busy status.  True = busy.
        /// </summary>
        private byte projectorIsBusy;

        /// <summary>
        /// External temperature reading in 10ths of degrees C
        /// </summary>
        private short temperatureExternalIn10thsCelsius;

        /// <summary>
        /// External relative humidity
        /// </summary>
        private ushort relativeHumidityInPercent;

        /// <summary>
        /// Battery voltage
        /// </summary>
        private ushort batteryVoltageInmV;

        /// <summary>
        /// Battery current
        /// </summary>
        private short batteryCurrentInmA;

        /// <summary>
        /// Battery temperature
        /// </summary>
        private short batteryTemperatureIn10thsCelcius;

        /// <summary>
        /// Battery charge state
        /// </summary>
        private short batteryChargeInPercent;

        /// <summary>
        /// Battery average time to empty
        /// </summary>
        private short batteryAvgTimeToEmptyInMinutes;

        /// <summary>
        /// Battery status
        /// </summary>
        private ushort batteryStatus;

        /// <summary>
        /// 5V rail voltage 
        /// </summary>
        private ushort power5VInmV;

        /// <summary>
        /// 12V rail voltage 
        /// </summary>
        private ushort power12VInmV;

        /// <summary>
        /// Accelerometer reading in gravities 
        /// </summary>
        private float accelForwardInG;

        /// <summary>
        /// Accelerometer reading in gravities
        /// </summary>
        private float accelRightInG;

        /// <summary>
        /// Accelerometer reading in gravities
        /// </summary>
        private float accelUpInG;

        /// <summary>
        /// Gyro x-axis
        /// </summary>
        private float gyroForwardInRadiansPerSecond;

        /// <summary>
        /// Gyro y-axis
        /// </summary>
        private float gyroRightInRadiansPerSecond;

        /// <summary>
        /// Gyro z-axis
        /// </summary>
        private float gyroUpInRadiansPerSecond;

        /// <summary>
        /// Left motor position
        /// </summary>
        private int motorLeftPositionInMm;

        /// <summary>
        /// Right motor position
        /// </summary>
        private int motorRightPositionInMm;

        /// <summary>
        /// Left motor velocity
        /// </summary>
        private float motorLeftVelocityInMperSec;

        /// <summary>
        /// Right motor velocity
        /// </summary>
        private float motorRightVelocityInMperSec;

        /// <summary>
        /// Left motor acceleration
        /// </summary>
        private float motorLeftAccelerationInMperSec2;

        /// <summary>
        /// Right motor acceleration
        /// </summary>
        private float motorRightAccelerationInMperSec2;

        /// <summary>
        /// State of various peripherals (on/off) using enum PowerStates
        /// </summary>
        private ushort powerStates;

        /// <summary>
        /// State of various binary sensors using enum DriveSensorStates
        /// </summary>
        private uint sensorStates;

        /// <summary>
        /// Projector heading in radians 
        /// </summary>
        private float projectorHeadingInRadians;

        /// <summary>
        /// Projector vertical inversion
        ///     bit 0 set == vertical inversion
        ///     bit 1 set == horizontal inversion
        /// </summary>
        private byte projectorInversion;

        /// <summary>
        /// Projector brightness
        /// </summary>
        private ushort projectorBrightness;

        /// <summary>
        /// Projector focus position in steps
        /// </summary>
        private short projectorFocusPositionInSteps;

        /// <summary>
        /// Projector idle
        /// </summary>
        private byte projectorIdle;

        /// <summary>
        /// Camera heading in radians 
        /// </summary>
        private float cameraHeadingInRadians;

        /// <summary>
        /// Turret heading in radians
        /// </summary>
        private float turretHeadingInRadians;

        /// <summary>
        /// Turret velocity in milli radians per sec.
        /// </summary>
        private float turretVelocityInMiliRadsPerSec;

        /// <summary>
        /// Left sonar reading in millimeters
        /// </summary>
        private ushort sonarDistanceLeftInMillimeters;

        /// <summary>
        /// Right sonar reading in millimeters
        /// </summary>
        private ushort sonarDistanceRightInMillimeters;

        /// <summary>
        /// Current setting of left cooling fan
        /// </summary>
        private float leftFanPower0to1;

        /// <summary>
        /// Current setting of right cooling fan
        /// </summary>
        private float rightFanPower0to1;

        /// <summary>
        /// Speed of left cooling fan
        /// </summary>
        private ushort leftFanRpm;

        /// <summary>
        /// Speed of right cooling fan
        /// </summary>
        private ushort rightFanRpm;

        /// <summary>
        /// Bit field used to determine which cliff sensor detected a cliff
        /// </summary>
        private byte cliffState;

        /// <summary>
        /// State of each servo controlled by the drive controller
        /// </summary>
        private ushort servoStates;

        /// <summary>
        /// Left Wheel ready for next sequence
        /// </summary>
        private byte leftWheelReadyForNextSequence;

        /// <summary>
        /// Right Wheel ready for next sequence
        /// </summary>
        private byte rightWheelReadyForNextSequence;

        /// <summary>
        /// Turret ready for next sequence
        /// </summary>
        private byte turretReadyForNextSequence;

        /// <summary>
        /// Gets or sets the Time stamp in 10s of milli-seconds
        /// </summary>
        public long TimeStamp
        {
            get
            {
                return this.timeStamp;
            }

            set
            {
                this.timeStamp = value;
            }
        }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 1 reading
        /// </summary>
        public int Prox1InMm
        {
            get
            {
                return this.prox1InMm;
            }

            set
            {
                this.prox1InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 2 reading
        /// </summary>
        public int Prox2InMm
        {
            get
            {
                return this.prox2InMm;
            }

            set
            {
                this.prox2InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 3 reading
        /// </summary>
        public int Prox3InMm
        {
            get
            {
                return this.prox3InMm;
            }

            set
            {
                this.prox3InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 4 reading
        /// </summary>
        public int Prox4InMm
        {
            get
            {
                return this.prox4InMm;
            }

            set
            {
                this.prox4InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 5 reading
        /// </summary>
        public int Prox5InMm
        {
            get
            {
                return this.prox5InMm;
            }

            set
            {
                this.prox5InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 6 reading
        /// </summary>
        public int Prox6InMm
        {
            get
            {
                return this.prox6InMm;
            }

            set
            {
                this.prox6InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 7 reading
        /// </summary>
        public int Prox7InMm
        {
            get
            {
                return this.prox7InMm;
            }

            set
            {
                this.prox7InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Proximity IR sensor 8 reading
        /// </summary>
        public int Prox8InMm
        {
            get
            {
                return this.prox8InMm;
            }

            set
            {
                this.prox8InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 1 reading
        /// </summary>
        public int Cliff1InMm
        {
            get
            {
                return this.cliff1InMm;
            }

            set
            {
                this.cliff1InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 2 reading
        /// </summary>
        public int Cliff2InMm
        {
            get
            {
                return this.cliff2InMm;
            }

            set
            {
                this.cliff2InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 3 reading
        /// </summary>
        public int Cliff3InMm
        {
            get
            {
                return this.cliff3InMm;
            }

            set
            {
                this.cliff3InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 4 reading
        /// </summary>
        public int Cliff4InMm
        {
            get
            {
                return this.cliff4InMm;
            }

            set
            {
                this.cliff4InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Cliff IR sensor 5 reading
        /// </summary>
        public int Cliff5InMm
        {
            get
            {
                return this.cliff5InMm;
            }

            set
            {
                this.cliff5InMm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Carry sensor, 1 = carry, 0 = no carry
        /// </summary>
        public byte CarryDetected
        {
            get
            {
                return this.carryDetected;
            }

            set
            {
                this.carryDetected = value;
            }
        }

        /// <summary>
        /// Gets or sets the Internal temperature reading in 10ths of degrees C
        /// </summary>
        public short TemperatureInternalIn10ThsCelsius
        {
            get
            {
                return this.temperatureInternalIn10thsCelsius;
            }

            set
            {
                this.temperatureInternalIn10thsCelsius = value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector temperature (Red) reading in degrees C
        /// </summary>
        public short TemperatureProjectorRedInCelsius
        {
            get
            {
                return this.temperatureProjectorRedInCelsius;
            }

            set
            {
                this.temperatureProjectorRedInCelsius = value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector temperature (Green) reading in degrees C
        /// </summary>
        public short TemperatureProjectorGreenInCelsius
        {
            get
            {
                return this.temperatureProjectorGreenInCelsius;
            }

            set
            {
                this.temperatureProjectorGreenInCelsius = value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector temperature (Blue) reading in degrees C
        /// </summary>
        public short TemperatureProjectorBlueInCelsius
        {
            get
            {
                return this.temperatureProjectorBlueInCelsius;
            }

            set
            {
                this.temperatureProjectorBlueInCelsius = value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector Busy Status
        /// </summary>
        public byte ProjectorIsBusy
        {
            get
            {
                return this.projectorIsBusy;
            }

            set
            {
                this.projectorIsBusy = value;
            }
        }

        /// <summary>
        /// Gets or sets the External temperature reading in 10ths of degrees C
        /// </summary>
        public short TemperatureExternalIn10ThsCelsius
        {
            get
            {
                return this.temperatureExternalIn10thsCelsius;
            }

            set
            {
                this.temperatureExternalIn10thsCelsius = value;
            }
        }

        /// <summary>
        /// Gets or sets the External relative humidity
        /// </summary>
        public int RelativeHumidityInPercent
        {
            get
            {
                return this.relativeHumidityInPercent;
            }

            set
            {
                this.relativeHumidityInPercent = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Battery voltage
        /// </summary>
        public int BatteryVoltageInmV
        {
            get
            {
                return this.batteryVoltageInmV;
            }

            set
            {
                this.batteryVoltageInmV = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Battery current
        /// </summary>
        public short BatteryCurrentInmA
        {
            get
            {
                return this.batteryCurrentInmA;
            }

            set
            {
                this.batteryCurrentInmA = value;
            }
        }

        /// <summary>
        /// Gets or sets the Battery temperature
        /// </summary>
        public short BatteryTemperatureIn10ThsCelcius
        {
            get
            {
                return this.batteryTemperatureIn10thsCelcius;
            }

            set
            {
                this.batteryTemperatureIn10thsCelcius = value;
            }
        }

        /// <summary>
        /// Gets or sets the Battery charge state
        /// </summary>
        public short BatteryChargeInPercent
        {
            get
            {
                return this.batteryChargeInPercent;
            }

            set
            {
                this.batteryChargeInPercent = value;
            }
        }

        /// <summary>
        /// Gets or sets the Battery average time to empty
        /// </summary>
        public short BatteryAvgTimeToEmptyInMinutes
        {
            get
            {
                return this.batteryAvgTimeToEmptyInMinutes;
            }

            set
            {
                this.batteryAvgTimeToEmptyInMinutes = value;
            }
        }

        /// <summary>
        /// Gets or sets the Battery status
        /// </summary>
        public int BatteryStatus
        {
            get
            {
                return this.batteryStatus;
            }

            set
            {
                this.batteryStatus = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the 5V rail voltage 
        /// </summary>
        public int Power5VInmV
        {
            get
            {
                return this.power5VInmV;
            }

            set
            {
                this.power5VInmV = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the 12V rail voltage 
        /// </summary>
        public int Power12VInmV
        {
            get
            {
                return this.power12VInmV;
            }

            set
            {
                this.power12VInmV = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Accelerometer reading in gravities 
        /// </summary>
        public float AccelForwardInG
        {
            get
            {
                return this.accelForwardInG;
            }

            set
            {
                this.accelForwardInG = value;
            }
        }

        /// <summary>
        /// Gets or sets the Accelerometer reading in gravities
        /// </summary>
        public float AccelRightInG
        {
            get
            {
                return this.accelRightInG;
            }

            set
            {
                this.accelRightInG = value;
            }
        }

        /// <summary>
        /// Gets or sets the Accelerometer reading in gravities
        /// </summary>
        public float AccelUpInG
        {
            get
            {
                return this.accelUpInG;
            }

            set
            {
                this.accelUpInG = value;
            }
        }

        /// <summary>
        /// Gets or sets the Gyro x-axis
        /// </summary>
        public float GyroForwardInRadiansPerSecond
        {
            get
            {
                return this.gyroForwardInRadiansPerSecond;
            }

            set
            {
                this.gyroForwardInRadiansPerSecond = value;
            }
        }

        /// <summary>
        /// Gets or sets the Gyro y-axis
        /// </summary>
        public float GyroRightInRadiansPerSecond
        {
            get
            {
                return this.gyroRightInRadiansPerSecond;
            }

            set
            {
                this.gyroRightInRadiansPerSecond = value;
            }
        }

        /// <summary>
        /// Gets or sets the Gyro z-axis
        /// </summary>
        public float GyroUpInRadiansPerSecond
        {
            get
            {
                return this.gyroUpInRadiansPerSecond;
            }

            set
            {
                this.gyroUpInRadiansPerSecond = value;
            }
        }

        /// <summary>
        /// Gets or sets the Left motor position
        /// </summary>
        public int MotorLeftPositionInMm
        {
            get
            {
                return this.motorLeftPositionInMm;
            }

            set
            {
                this.motorLeftPositionInMm = value;
            }
        }

        /// <summary>
        /// Gets or sets the Right motor position
        /// </summary>
        public int MotorRightPositionInMm
        {
            get
            {
                return this.motorRightPositionInMm;
            }

            set
            {
                this.motorRightPositionInMm = value;
            }
        }

        /// <summary>
        /// Gets or sets the Left motor velocity
        /// </summary>
        public float MotorLeftVelocityInMperSec
        {
            get
            {
                return this.motorLeftVelocityInMperSec;
            }

            set
            {
                this.motorLeftVelocityInMperSec = value;
            }
        }

        /// <summary>
        /// Gets or sets the Right motor velocity
        /// </summary>
        public float MotorRightVelocityInMperSec
        {
            get
            {
                return this.motorRightVelocityInMperSec;
            }

            set
            {
                this.motorRightVelocityInMperSec = value;
            }
        }

        /// <summary>
        /// Gets or sets the Left motor acceleration
        /// </summary>
        public float MotorLeftAccelerationInMperSec2
        {
            get
            {
                return this.motorLeftAccelerationInMperSec2;
            }

            set
            {
                this.motorLeftAccelerationInMperSec2 = value;
            }
        }

        /// <summary>
        /// Gets or sets the Right motor acceleration
        /// </summary>
        public float MotorRightAccelerationInMperSec2
        {
            get
            {
                return this.motorRightAccelerationInMperSec2;
            }

            set
            {
                this.motorRightAccelerationInMperSec2 = value;
            }
        }

        /// <summary>
        /// Gets or sets the state of various peripherals (on/off) using enum PowerStates
        /// </summary>
        public PowerStates PowerStates
        {
            get
            {
                return (PowerStates)this.powerStates;
            }

            set
            {
                this.powerStates = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the state of various binary sensors using enum DriveSensorStates
        /// </summary>
        public DriveSensorStates SensorStates
        {
            get
            {
                return (DriveSensorStates)this.sensorStates;
            }

            set
            {
                this.sensorStates = (uint)value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector heading in radians 
        /// </summary>
        public float ProjectorHeadingInRadians
        {
            get
            {
                return this.projectorHeadingInRadians;
            }

            set
            {
                this.projectorHeadingInRadians = value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector vertical inversion
        /// </summary>
        /// <remarks>
        ///     bit 0 set == vertical inversion
        ///     bit 1 set == horizontal inversion
        /// </remarks>
        public byte ProjectorInversion
        {
            get
            {
                return this.projectorInversion;
            }

            set
            {
                this.projectorInversion = value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector brightness
        /// </summary>
        public int ProjectorBrightness
        {
            get
            {
                return this.projectorBrightness;
            }

            set
            {
                this.projectorBrightness = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector focus position in steps
        /// </summary>
        public short ProjectorFocusPositionInSteps
        {
            get
            {
                return this.projectorFocusPositionInSteps;
            }

            set
            {
                this.projectorFocusPositionInSteps = value;
            }
        }

        /// <summary>
        /// Gets or sets the Projector idle
        /// </summary>
        public byte ProjectorIdle
        {
            get
            {
                return this.projectorIdle;
            }

            set
            {
                this.projectorIdle = value;
            }
        }

        /// <summary>
        /// Gets or sets the Camera heading in radians 
        /// </summary>
        public float CameraHeadingInRadians
        {
            get
            {
                return this.cameraHeadingInRadians;
            }

            set
            {
                this.cameraHeadingInRadians = value;
            }
        }

        /// <summary>
        /// Gets or sets the Turret heading in radians
        /// </summary>
        public float TurretHeadingInRadians
        {
            get
            {
                return this.turretHeadingInRadians;
            }

            set
            {
                this.turretHeadingInRadians = value;
            }
        }

        /// <summary>
        /// Gets or sets the Turret velocity in milli radians per sec.
        /// </summary>
        public float TurretVelocityInMiliRadsPerSec
        {
            get
            {
                return this.turretVelocityInMiliRadsPerSec;
            }

            set
            {
                this.turretVelocityInMiliRadsPerSec = value;
            }
        }

        /// <summary>
        /// Gets or sets the Left sonar reading in millimeters
        /// </summary>
        public int SonarDistanceLeftInMillimeters
        {
            get
            {
                return this.sonarDistanceLeftInMillimeters;
            }

            set
            {
                this.sonarDistanceLeftInMillimeters = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Right sonar reading in millimeters
        /// </summary>
        public int SonarDistanceRightInMillimeters
        {
            get
            {
                return this.sonarDistanceRightInMillimeters;
            }

            set
            {
                this.sonarDistanceRightInMillimeters = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Current setting of left cooling fan
        /// </summary>
        public float LeftFanPower0To1
        {
            get
            {
                return this.leftFanPower0to1;
            }

            set
            {
                this.leftFanPower0to1 = value;
            }
        }

        /// <summary>
        /// Gets or sets the Current setting of left cooling fan
        /// </summary>
        public float RightFanPower0To1
        {
            get
            {
                return this.rightFanPower0to1;
            }

            set
            {
                this.rightFanPower0to1 = value;
            }
        }

        /// <summary>
        /// Gets or sets the Speed of left cooling fan
        /// </summary>
        public int LeftFanRpm
        {
            get
            {
                return this.leftFanRpm;
            }

            set
            {
                this.leftFanRpm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Speed of right cooling fan
        /// </summary>
        public int RightFanRpm
        {
            get
            {
                return this.rightFanRpm;
            }

            set
            {
                this.rightFanRpm = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Bit field used to determine which cliff sensor detected a cliff
        /// </summary>
        public CliffSensorStates CliffState
        {
            get
            {
                return (CliffSensorStates)this.cliffState;
            }

            set
            {
                this.cliffState = (byte)value;
            }
        }

        /// <summary>
        /// Gets or sets the State of each servo controlled by the drive controller
        /// </summary>
        public int ServoStates
        {
            get
            {
                return this.servoStates;
            }

            set
            {
                this.servoStates = (ushort)value;
            }
        }

        /// <summary>
        /// Gets or sets the Left Wheel ready for next sequence
        /// </summary>
        public byte LeftWheelReadyForNextSequence
        {
            get
            {
                return this.leftWheelReadyForNextSequence;
            }

            set
            {
                this.leftWheelReadyForNextSequence = value;
            }
        }

        /// <summary>
        /// Gets or sets the Right Wheel ready for next sequence
        /// </summary>
        public byte RightWheelReadyForNextSequence
        {
            get
            {
                return this.rightWheelReadyForNextSequence;
            }

            set
            {
                this.rightWheelReadyForNextSequence = value;
            }
        }

        /// <summary>
        /// Gets or sets the Turret ready for next sequence
        /// </summary>
        public byte TurretReadyForNextSequence
        {
            get
            {
                return this.turretReadyForNextSequence;
            }

            set
            {
                this.turretReadyForNextSequence = value;
            }
        }
    }
}
